home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Select: Games Special 4
/
THE BEST OF SELECT Games Special 4 (Select CD-ROM)(1996).iso
/
dosgames
/
abuse
/
lisp
/
people.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1995-09-13
|
23KB
|
881 lines
;; Copyright 1995 Crack dot Com, All Rights reserved
;; See licensing information for more details on usage rights
(setq bright_tint (def_tint "art/tints/cop/bright.spe")) ;; used when the player fires a weapon
(setq player_tints (make-array 6 :initial-contents (list
(def_tint "art/tints/cop/blue.spe")
(def_tint "art/tints/cop/africa.spe")
(def_tint "art/tints/cop/fire.spe")
(def_tint "art/tints/cop/olive.spe")
(def_tint "art/tints/cop/land.spe")
(def_tint "art/tints/cop/gold.spe")
)))
(setq cop_dead_parts (make-array (* 4 3) :initial-contents
; head arm leg
'((CP_1 "4dha") (CP_2 "4daa") (CP_3 "4dba") ; disapear
(CP_4 "4dhf") (CP_5 "4daf") (CP_6 "4dbf") ; flaming
(CP_7 "4dae") (CP_8 "4dle") (CP_9 "4dbe") ; electrical
(CP_10 "4dhn") (CP_11 "4dan") (CP_12 "4dbn")))) ; normal
(do ((i 0 (setq i (+ i 1))))
((>= i 12) nil)
(setq (aref cop_dead_parts i)
(make_dead_part (car (aref cop_dead_parts i))
(car (cdr (aref cop_dead_parts i))) 4 "art/cop.spe" 'dead_cop_part_draw)))
(setf fast_image (def_image "art/misc.spe" "fast_image"))
(setf fly_image (def_image "art/misc.spe" "fly_image"))
(setf sneaky_image (def_image "art/misc.spe" "sneaky_image"))
(setf health_image (def_image "art/misc.spe" "b_check_image"))
(defun give_player_health (amount)
(let ((h_amount (select difficulty
('easy amount)
('medium (/ (* amount 3) 4))
('hard (/ amount 2))
('extreme (/ amount 4))))
(h_max (if (eq special_power HEALTH_POWER)
200
100)))
(if (eq (hp) h_max)
nil
(progn
(if (<= (+ (hp) h_amount) h_max)
(add_hp h_amount)
(add_hp (- h_max (hp))))
(setq b_ramp (+ b_ramp (* h_amount 2)))
T)))
)
(defun pressing_action_key ()
(> (player_y_suggest) 0))
; signals for user function
(enum 'SET_SNEAKY_TIME
'SET_VISOR_TIME
'SET_FAST_TIME
'SET_FADE_COUNT
)
; states for cop
(enum 'JUST_START
'NORMAL_PLAY)
(enum 'NO_POWER
'FAST_POWER
'FLY_POWER
'SNEAKY_POWER
'HEALTH_POWER)
(defun cop_ufun (signal value)
(if (< (total_objects) 1) ; make sure upper body is there
nil
(select signal
(SET_SNEAKY_TIME
(progn
(set_sneaky_time value)
(with_obj0 (set_sneaky_time value))))
(SET_VISOR_TIME (set_visor_time value))
(SET_FAST_TIME
(progn
(set_fast_time value)
(with_obj0 (set_fast_time value))))
(SET_FADE_COUNT (set_fade_count value)
(with_obj0 (set_fade_count value)))
)))
(defun cop_adjust_top (return)
(if (< (total_objects) 1) ;; should be here
(let ((me (me)))
(link_object (add_object_after MGUN_TOP (x) (y)))
(with_obj0 (link_object me))
))
return
)
(defun climb_off_handler ()
(if (next_picture)
(progn
(view_push_down 4)
0)
(progn
(set_y (- (y) 28))
(set_state stopped)
0)))
(defun climb_handler (xm ym but)
(let ((yd in_climbing_area))
(setq in_climbing_area 0)
(if (eq (state) climb_off)
(climb_off_handler)
(if (eq (state) climbing)
(progn
(if (> ym 0)
(progn
(if (eq (current_frame) 0) (set_current_frame 9)
(set_current_frame (- (current_frame) 1)))
(set_y (+ (y) 3)))
(if (< ym 0)
(progn
(if (< yd 32)
(set_state climb_off)
(progn
(if (not (next_picture)) (set_state climbing))
(set_y (- (y) 3)))))))
(if (not (eq xm 0))
(if (can_see (x) (- (y) 20) (x) (y) nil)
(if (eq ym 0)
(progn
(set_state run_jump_fall)
(set_gravity 1))
(progn
(set_state run_jump)
(set_yvel (get_ability jump_yvel))
(set_gravity 1)
))))
0)
(if (and (>= (yvel) 0) (or (> ym 0)
(and (< ym 0) (> yd 8))))
(progn
(set_state climbing)
(set_gravity 0)
(set_xvel 0)
(set_yvel 0)
(set_xacel 0)
(set_yacel 0)
0)
(progn
(next_picture)
(cop_adjust_top (mover xm ym but))))
))))
(defun undo_special_power (xm ym but)
(select special_power
(FAST_POWER (setq used_special_power 0))
(SNEAKY_POWER (if (> used_special_power 0)
(setq used_special_power (- used_special_power 1))))))
(defun do_special_power (xm ym but)
(select special_power
(FLY_POWER
(add_object CLOUD (+ (+ (x) (* (direction) -10)) (random 5)) (+ (y) (random 5)))
(set_state run_jump)
(set_gravity 1)
(set_yacel 0)
(if (> (yvel) 0) (set_yvel (/ (yvel) 2)))
(set_yvel (- (yvel) 2))
(if (< ym 0)
(set_yvel (- (yvel) 1)))
)
(FAST_POWER
(setq used_special_power 1)
(setq last1_x (x))
(setq last1_y (y))
(if (> (total_objects) 0)
(with_obj0
(if (> fire_delay1 0)
(setq fire_delay1 (- fire_delay1 1)))))
(let ((in_area in_climbing_area)
(old_yvel (yvel)))
(player_move xm ym but)
(setq in_climbing_area in_area)
(if (and (< ym 0) (eq old_yvel 0) (< (yvel) 0))
(set_yvel (+ (yvel) (/ (yvel) 3))))
)
(setq last2_x (x))
(setq last2_y (y)))
(SNEAKY_POWER (if (<= used_special_power 15)
(setq used_special_power (+ used_special_power 1))))
))
(defun player_move (xm ym but)
(if (eq in_climbing_area 0)
(progn
(if (eq (state) climbing)
(progn
(set_gravity 1)
(set_state run_jump_fall)))
(next_picture)
(cop_adjust_top (mover xm ym but)))
(climb_handler xm ym but)))
/*(defun cop_mover (xm ym but)
(if (> (yvel) 10)
(progn
(set_yacel 0)
(set_yvel (- (yvel) 1)))) ;; terminal velocity
(select (aistate)
(JUST_START
(if (eq but 0) ; wait till user lets go of button before moving
(progn
(set_aistate NORMAL_PLAY)
(mover xm ym but))
(cop_adjust_top (tick))))
(NORMAL_PLAY
(if (or (<= (hp) 0) (eq (state) dieing) (eq (state) dead)) ; are we dead?
(progn
(if (not (eq (state) dead))
(if (not (eq (state) dieing))
(progn
(set_state dieing)
(set_xvel 0)
(set_yvel 0)
(set_xacel 0)
(set_yacel 0))
(if (not (next_picture))
(set_state dead) nil))
(if (not (eq but 0)) ; wait till dead and pressing but, then reset
(progn
(restart_player)
(set_aistate JUST_START))
(cop_adjust_top (tick))))
0)
; normal play code
(progn
; check to see if player is firing
(if (equal (bit-and but 1) 1)
(do_special_power xm ym but)
(undo_special_power xm ym but))
(let ((ret (player_move xm ym but))
(other (me)))
(with_obj0
(progn
(set_x (with_object other (x)))
(set_y (- (- (with_object other (y)) -29)
(with_object other (picture_height))))
))
(if (and (equal (bit-and but 2) 2)
(not (eq (state) dead)) (not (eq (state) dieing)))
(let ((ammo (ammo_total (current_weapon_type))))
(add_ammo (current_weapon_type) (with_obj0
(user_fun 'FIRE ammo)))
nil))
ret)
)))))
)*/
;;(defun normal_bottom_mover () ;; just runs around
(defun dead_cop_part_draw ()
(if (eq (aitype) 0)
(draw)
(draw_tint (aref player_tints (aitype)))))
(defun bottom_damage (amount from hitx hity push_xvel push_yvel) ; transfer damage to lower half
(if (eq is_teleporting 1)
nil
(let ((amount (select difficulty;; reduce damage according to difficulty
('easy (/ amount 2))
('medium (/ (* amount 3) 4))
('hard amount)
('extreme (* amount 2))
)))
(select (aistate)
(NORMAL_PLAY (if (and (not (eq (state) dieing)) (not (eq (state) dead)))
(progn
(if (eq (random 2) 0)
(set_state flinch_up)
(set_state flinch_down))
(setq r_ramp (+ r_ramp (* amount 7)))
(setq g_ramp (- g_ramp (* amount 14)))
(setq b_ramp (- b_ramp (* amount 14)))
(if (> r_ramp 120) (setq r_ramp 120))
(if (< g_ramp 0) (setq g_ramp 0))
(if (< b_ramp 0) (setq b_ramp 0))
(damage_